package io.github.talelin.latticy.service.oms;

import com.baomidou.mybatisplus.core.metadata.IPage;
import io.github.talelin.latticy.dto.oms.inbound_order.*;
import io.github.talelin.latticy.model.oms.InboundOrderDO;
import com.baomidou.mybatisplus.extension.service.IService;
import io.github.talelin.latticy.vo.ReceivingRecordVO;
import io.github.talelin.latticy.vo.oms.InboundOrderDetailsVo;
import io.github.talelin.latticy.vo.oms.InboundOrderPageVo;

import java.util.List;

/**
 * <p>
 * 入库单表 服务类
 * </p>
 *
 * @author generator@mrxiao
 * @since 2022-05-16
 */
public interface InboundOrderService extends IService<InboundOrderDO> {

    /**
     * 创建入库单
     *
     * @param validator 创建入库单校验器
     * @return 被创建的入库单
     */
    void createInboundOrder(InboundOrderCreateDTO validator);



    /**
     * 根据code查询入库单
     *
     * @param inboundOrderNo
     * @return
     */
    InboundOrderDetailsVo getInboundOrderByNo(String inboundOrderNo);


    /**
     * 更新入库单
     *
     * @param updateVo
     * @return
     */
    void updateInboundOrder(InboundOrderUpdateDTO updateVo);

    /**
     * 重做入库单
     *
     * @param receivingRecordVOS
     * @return
     */
    boolean redoInboundOrder(List<ReceivingRecordVO> receivingRecordVOS);


    /**
     * 验证入库单是否存在
     *
     * @param inboundOrderNo
     * @return
     */
    boolean checkInboundOrderExistByCode(String inboundOrderNo);

    /**
     * 删除入库单
     *
     * @param inboundOrderNoList
     */
    void deleteInboundOrder(List<String> inboundOrderNoList);

    /**
     * 查询入库单列表
     *
     * @param dto
     * @return
     */
    IPage<InboundOrderPageVo> getInboundOrderPage(InboundOrderPageDTO dto);

    /**
     * 入库单拉入作废状态
     * @param listDTO
     */
    void draftInboundOrder(InboundOrderListDTO listDTO);

    /**
     * 审核入库单
     * @param listDTO
     */
    void auditInboundOrder(InboundOrderListDTO listDTO);

    /**
     * 入库单收货
     * @param receivingPackageDTO
     */
    void inboundOrderReceiving(ReceivingRecordDTO receivingPackageDTO);

    /**
     * 入库单上架完成
     * @param inboundOrderOpenFeignDTO
     */
    void putAwayInboundOrder(InboundOrderOpenFeignDTO inboundOrderOpenFeignDTO);
}
